#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>

//visible in file
//live in program
static int n;

//visible in project
//live in program
int p;

void f1()
{

//visible in block
//live in function
int n;
n=4;
printf("local n in f1(): %08p\n",&n);
printf("local n in f1(): %d\n\n",n);

}

void f3()
{

//visible in block
//live in program
static int m = 4;
m++;
printf("local static m in f3(): %08p\n",&m);
printf("local static m in f3(): %d\n\n",m);

}

int main()
{

printf("global variable p\n");
printf("global static variable n\n");
printf("local variable n in f1()\n");
printf("local static variable m\n");
printf("global static variable n_1\n");
printf("\n");

n=3;
printf("global static n in main(): %08p\n",&n);
printf("global static n in Main: %d\n\n",n);

p=3;
printf("global variable p in main(): %08p\n",&p);
printf("global variable p in Main: %d\n\n",p);

f1();
printf("global static n in main(): %08p\n",&n);
printf("global static n in Main: %d\n\n",n);

int i;
for(i=0; i<3; i++)
{
	f3();
}

f2();
printf("global static n in main(): %08p\n",&n);
printf("global static n in Main: %d\n\n",n);

printf("global variable p in main(): %08p\n",&p);
printf("global variable p in Main: %d\n\n",p);

return 0;
}
